echo hi | cat
echo hi | cat > /root/file
echo hi > /root/file
# Wrong echo hi sudo > /root/file
# Wrong sudo echo hi > /root/file
# Wrong sudo echo hi | sudo cat > /root/file
echo hi | tee tfile
cat tfile
echo hi | sudo tee /root/file # Correct
echo hi | sudo tee /root/file > /dev/null # if you don't wanna see the output
# see whats happening between commands
cat tfile | sort | uniq -d | head -3 | grep -iv "Milad" > z; cat < z;
# lets say some thing is wrong
cat tfile | sort | tee check | uniq -d | head -3 | grep -iv "Milad" > z; cat < z;
cat check
ipynb
format: https://github.com/ravexina/linux-notes. html
exports of project available at: https://ravexina.github.io/linux-notes.Linux Notes by Milad As (Ravexina) is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.